<div class="modal hide fade" id="myModal2">
<div class="modal-header">
    <button class="close" data-dismiss="modal">x</button>
    <h3>REGISTRO DE ALUMNOS</h3>
</div>
	<?php echo $this->Form->create('Alumnos', array('action' => 'guardaexcel', 'enctype' => 'multipart/form-data')); ?>
		<div class="formSep">
			<div class="modal-body">
				<div class="span4">
						Selexionar Excel:   
					<span class="input file">
                            <span class="file-text"></span>
                            <input type="file" name="data[Excel][excel]" id="special-input-1" value="" class="file withClearFunctions" multiple="" />
                    </span>
				</div>
			</div>
		</div>
		<div class="form-actions">
			<button class="btn btn-success" type="submit">
				Guardar Excel
			</button>
		</div>
        </form>
		
</div>

<div class="modal hide fade" id="myModal23">

<div class="modal-header">
    <button class="close" data-dismiss="modal">x</button>
    <h3>Modificacion Alumno</h3>
</div>
<div align="center">
<div id="cargaDatos">
	</div>
</div>
	
		
</div>

<div class="row-fluid">
    <div class="span12">
                
                    <div class="span10">
                    
                    <h3 class="heading">Listado de Alumnos <input type="button" value="Busqueda" onclick='$("#formulario").toggle(400);' ></h3>
                    
                    
                    
                    
        <div id="formulario" style="display: none;">
        <h4>BUSCAR ALUMNO</h4>    
        <?php echo $this->Form->create('Alumno'); ?> 
        <div class="formSep">
            <div class="row-fluid">
                <div class="span4">
                    <label>Nombre </label>
                    <?php echo $this->Form->text('Alumno.nombre');?>
                </div>
                <div class="span4">
                    <label>Apellido Paterno </label>
                    <?php echo $this->Form->text('Alumno.ap_paterno');?>
                </div>
                <div class="span4">
                    <label>Apellido Materno </label>
                    <?php echo $this->Form->text('Alumno.ap_materno');?>
                </div>
            </div>
            
        </div>
    
        <div class="form-actions">
            <?php
            echo $this->Js->submit('Buscar', array('url' => '/Alumnos/ajaxlistado', 'update' => '#listado'));
            echo $this->Form->end();
            ?>      
        </div> 
        </div>
        <div id="listado">
        <table class="table table-striped table-bordered dTableR" id="dt_a">       
            <thead>
                <tr>                       
                    <th>Nombre</th>
                    <th>Apellido Paterno</th>
                    <th>Apellido Materno</th>                    
                    <th>Acciones</th>     
                </tr>
            </thead>
            <tbody>
                <?php foreach ($alumnos as $a): ?>
                <?php $idAlumno = $a['Alumno']['id']; ?>
                    <tr>                         
                        <td><?php echo $a['Alumno']['nombre']; ?></td>
                        <td><?php echo $a['Alumno']['ap_paterno']; ?></td>
                        <td><?php echo $a['Alumno']['ap_materno']; ?></td>                        
                        <td>
                            <?php echo $this->Html->image("iconos/alumparalelo.png", array("title" => "Alumnos Paralelos",'url' => array('controller'=>'AlumnosParalelos','action'=>'listalumnosparalelos', $idAlumno)));?> 
                            <?php echo $this->Html->image("iconos/plan.png", array("title" => "Plan",'url' => array('action' => 'verplan', $idAlumno)));?> 
                            <?php //echo $this->Html->link('ALUMNOS PARALELOS  -',array('controller'=>'AlumnosParalelos','action'=>'listalumnosparalelos',$idAlumno));?>
                            <?php //echo $this->Html->link('PLAN', array('action'=>'verplan',$idAlumno)); ?>
                            <?php
                            echo $this->Ajax->link(
                                    $this->Html->image("iconos/dalumno.png",array(
                                        'data-toggle'=>'modal',
                                        'data-backdrop'=>'static',
                                        'href'=>'#myModal23')), 
                                    array(
                                        'controller' => 'alumnos', 
                                        'action' => 'ajaxdetalle', $idAlumno
                                    ), 
                                    array(
                                        'update' => 'cargaDatos',
                                        'title' => 'Detalle del Alumno',
                                        'escape' => false
                                   )
                            );
                            ?>
                                                        
                             <?php 
                                echo $this->Html->image("iconos/edit.png", array(
                                    "title" => "Editar",
                                    'url' => array('action' => 'editar', $idAlumno)
                                ));
                            ?>                             
                             <?php 
                                echo $this->Html->image("iconos/elim.png", array(
                                    "title" => "Eliminar",
                                    'url' => array('action' => 'eliminar', $idAlumno)
                                ));
                            ?>
                            
                                                                                     
                            
                            <?php
                            echo $this->Ajax->link(
                                    $this->Html->image("iconos/cuentas.png",array(
                                        'data-toggle'=>'modal',
                                        'data-backdrop'=>'static',
                                        'href'=>'#myModal23')), 
                                    array(
                                        'controller' => 'alumnos', 
                                        'action' => 'pagar', $idAlumno
                                    ), 
                                    array(
                                        'update' => 'cargaDatos',
                                        'title' => 'Pagos a cancelar',
                                        'escape' => false
                                   )
                            );
                            ?> 
                            
                            <?php
                            echo $this->Ajax->link(
                                    $this->Html->image("iconos/cambiop.png",array(
                                        'data-toggle'=>'modal',
                                        'data-backdrop'=>'static',
                                        'href'=>'#myModal23')), 
                                    array(
                                        'controller' => 'Alumnos', 
                                        'action' => 'ajaxcambiaplan', $idAlumno
                                    ), 
                                    array(
                                        'update' => 'cargaDatos',
                                        'title' => 'Cambio de Plan de Pago',
                                        'escape' => false
                                   )
                            );
                            ?>
                        </td>
                    </tr>
                    <?php endforeach; ?>
            </tbody>
        </table>
        <a data-toggle="modal" data-backdrop="static" href="#myModal2">
    <?php 
    echo $this->Form->button('Registrar Excel',array('class' => 'btn btn-success'));
    ?>  
    </a>
    <?php 
    echo $this->Html->link('Descargar Plantilla',$this->Html->webroot("../app/webroot/files/PlantillaAlumnos.xlsx"),array('class' => 'btn btn-success'));
    ?>
    
        </div>
        
</div>
    </div>
       
</div>

<!-- sidebar -->
<?php echo $this->element('sidebar/alumno'); ?>
<!-- fin sidebar -->
<?php //llamamos scripts tablas ?>
<?php echo $this->element('jstablas'); ?>
<?php echo $this->Js->writeBuffer(); ?>
